package naga.x.resource.app;

import java.util.Set;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import naga.x.resource.App;

@Configuration
@EnableAutoConfiguration
@ConfigurationProperties(locations = "classpath:application.properties", prefix = "app")
public class AppConfig implements InitializingBean {

	private String resPath;
	private Set<String> ipWhiteList;

	public String getResPath() {
		return resPath;
	}

	public void setResPath(String resPath) {
		this.resPath = resPath;
	}

	public Set<String> getIpWhiteList() {
		return ipWhiteList;
	}

	public void setIpWhiteList(Set<String> ipWhiteList) {
		this.ipWhiteList = ipWhiteList;
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		App.LOG.info("resPath={}", resPath);
		App.LOG.info("ipWhiteList={},size={}", ipWhiteList, ipWhiteList.size());
	}

}
